package utils;

import javax.swing.JOptionPane;

public class MsgBox extends Handler{

	/**
     * Show an error msg to user
     */
    public static void showError(String msg){
        JOptionPane.showMessageDialog(null, msg, Constants.APP_NAME, JOptionPane.ERROR_MESSAGE);
    }

    /**
     * Cofirm user choice
     */
    public static Boolean confirm(String msg) {
        int option = JOptionPane.showConfirmDialog(null, msg, Constants.APP_NAME, JOptionPane.YES_NO_CANCEL_OPTION);
        if(option == JOptionPane.YES_OPTION)
            return true;

        return false; // NO_OPTION or CANCEL_OPTION
    }

    /**
     * Inform a msg to user
     */
    public static void inform(String msg) {
        JOptionPane.showMessageDialog(null, msg, Constants.APP_NAME, JOptionPane.INFORMATION_MESSAGE);
    }
    /**
     * Error message couldn't open notepad
     */
	public void handleRequest() {
		MsgBox.showError("Notepad could not be opened");
	}


}
